package com.project.sianet.data;

import android.app.Activity;
import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.project.sianet.R;
import com.project.sianet.fragment.*;

public class TabFragmentPagerAdapter extends FragmentPagerAdapter {

	private Context mContext;
    private String[] mTabs;
    
    public TabFragmentPagerAdapter(FragmentManager fm, Activity activity) {
        super(fm);
        this.mContext = activity.getApplicationContext();
        mTabs = new String[] { mContext.getString(R.string.msje_recibidos), mContext.getString(R.string.msje_enviados) };
    }

    @Override
    public Fragment getItem(int index) {
        switch (index) {
            case 0:
                return new MensajeRecibidoFragment();
            case 1:
                return new MensajeEnviadoFragment();
        }
        return null;
    }

    @Override
    public int getCount() {
        return mTabs.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTabs[position];
    }
    
}
